package config

type UPLOAD struct {
	Type    string        `mapstructure:"TYPE" yaml:"type" json:"type"`          // 存储类型 local, cos, oss, qiniu
	SaveKey string        `mapstructure:"SAVEKEY" yaml:"savekey" json:"savekey"` // 存储路径
	MaxSize int           `mapstructure:"MAXSIZE" yaml:"maxsize" json:"maxsize"` // 最大上传大小 mb
	Local   UploadLocal   `mapstructure:"LOCAL" yaml:"local" json:"local"`       // 本地存储
	Tencent UploadTencent `mapstructure:"TENCENT" yaml:"tencent" json:"tencent"` // 腾讯云存储
	Ali     UploadAli     `mapstructure:"ALI" yaml:"ali" json:"ali"`             // 阿里云存储
	Qiniu   UploadQiniu   `mapstructure:"QINIU" yaml:"qiniu" json:"qiniu"`       // 七牛云存储
}

type UploadLocal struct {
	SavePath  string `mapstructure:"SAVEPATH" yaml:"savepath" json:"savepath"` // 本地存储路径
	Chunking  bool   `mapstructure:"CHUNKING" yaml:"chunking" json:"chunking"` // 是否分片
	ChunkSize int64  `mapstructure:"CHUNKSIZE" yaml:"chunk_size" json:"chunk_size"`
}

type UploadTencent struct {
	Bucket     string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
	Region     string `mapstructure:"region" json:"region" yaml:"region"`
	SecretID   string `mapstructure:"secret-id" json:"secret-id" yaml:"secret-id"`
	SecretKey  string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"`
	BaseURL    string `mapstructure:"base-url" json:"base-url" yaml:"base-url"`
	PathPrefix string `mapstructure:"path-prefix" json:"path-prefix" yaml:"path-prefix"`
}

type UploadAli struct {
	Endpoint        string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"`
	AccessKeyId     string `mapstructure:"access-key-id" json:"access-key-id" yaml:"access-key-id"`
	AccessKeySecret string `mapstructure:"access-key-secret" json:"access-key-secret" yaml:"access-key-secret"`
	BucketName      string `mapstructure:"bucket-name" json:"bucket-name" yaml:"bucket-name"`
	BucketUrl       string `mapstructure:"bucket-url" json:"bucket-url" yaml:"bucket-url"`
	BasePath        string `mapstructure:"base-path" json:"base-path" yaml:"base-path"`
}

type UploadQiniu struct {
	Zone          string `mapstructure:"zone" json:"zone" yaml:"zone"`                                  // 存储区域
	Bucket        string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`                            // 空间名称
	ImgPath       string `mapstructure:"img-path" json:"img-path" yaml:"img-path"`                      // CDN加速域名
	UseHTTPS      bool   `mapstructure:"use-https" json:"use-https" yaml:"use-https"`                   // 是否使用https
	AccessKey     string `mapstructure:"access-key" json:"access-key" yaml:"access-key"`                // 秘钥AK
	SecretKey     string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"`                // 秘钥SK
	UseCdnDomains bool   `mapstructure:"use-cdn-domains" json:"use-cdn-domains" yaml:"use-cdn-domains"` // 上传是否使用CDN上传加速
}
